﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Jayden.Dll.Cards.Drawing
{
	public class SeatImage
	{
		private Image m_InactiveSeat;
		private Image m_ActiveSeat;
		private Image m_Timer;

		private Point m_TimerPosition;

		public SeatImage(string activeSeat, string inactiveSeat, string timer, Point timerPosition)
		{
			m_ActiveSeat = Image.FromFile(activeSeat);
			m_InactiveSeat = Image.FromFile(inactiveSeat);
			m_Timer = Image.FromFile(timer);
			m_TimerPosition = timerPosition;
		}

		public Image InactiveSeat { get { return m_InactiveSeat; } }
		public Image ActiveSeat { get { return m_ActiveSeat; } }
		public Image TimerSeat(double pct)
		{
			Bitmap image = new Bitmap(m_ActiveSeat);
			int width = (int)(m_Timer.Width * pct);
			using(Graphics g = Graphics.FromImage(image))
			{
				g.DrawImage(m_Timer, new Rectangle(m_TimerPosition, new Size(width, m_Timer.Height)), new Rectangle(0,0,width, m_Timer.Height), GraphicsUnit.Pixel);
			}
			return image;
		}
	}
}
